package com.atguigu.srb.base.exception;

import com.atguigu.srb.common.result.ResultCodeEnum;
import lombok.Data;

// Exception属于编译时异常 必须处理
//RuntimeException属于运行时异常 代码中无需try-catch处理
@Data
public class SrbException extends RuntimeException{
    private Integer code;
    private String message;

    public SrbException(ResultCodeEnum resultCodeEnum){
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }

}
